package com.ly.dingtalk.service.dept;

import java.util.List;

import com.aliyun.dingtalkcontact_1_0.models.SearchDepartmentResponse;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListparentbydeptResponse;
import com.dingtalk.api.response.OapiV2DepartmentListparentbyuserResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubidResponse;
import com.ly.dingtalk.constant.Language;

import lombok.NonNull;

/**
 * 钉钉部门
 *
 * @author wangzhen
 */
public interface IDingDeptHandler {

    /**
     * https://open.dingtalk.com/document/isvapp/query-department-details0-v2
     * 部门详情
     *
     * @param deptId   部门id
     * @param language 语言：zh_CN 或 en_US
     * @return 部门详情
     */
    OapiV2DepartmentGetResponse.DeptGetResponse getByDeptId(@NonNull Long deptId, @NonNull Language language);

    /**
     * https://open.dingtalk.com/document/isvapp/obtain-a-sub-department-id-list-v2
     * 子部门id列表
     *
     * @param deptId 父部门id
     * @return 子部门id列表
     */
    OapiV2DepartmentListsubidResponse.DeptListSubIdResponse getDeptIdList(@NonNull Long deptId);

    /**
     * 获取所有部门
     *
     * @return 子部门集合
     */
    List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList();

    /**
     * https://open.dingtalk.com/document/isvapp/get-department-list
     * 获取部门列表
     *
     * @param deptId   指定父部门id
     * @param language 语言：zh_CN 或 en_US
     * @return 子部门集合
     */
    List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId, @NonNull Language language);

    /**
     * https://open.dingtalk.com/document/isvapp/query-the-list-of-all-parent-departments-of-a-department
     * 获取指定部门的所有父部门列表
     *
     * @param deptId 子部门id
     * @return 所有父部门列表
     */
    OapiV2DepartmentListparentbydeptResponse.DeptListParentByDeptIdResponse getParentDeptListByDeptId(@NonNull Long deptId);

    /**
     * https://open.dingtalk.com/document/isvapp/queries-the-list-of-all-parent-departments-of-a-user
     * 获取指定用户的所有父部门列表
     *
     * @param userId 用户id
     * @return 所有父部门列表
     */
    OapiV2DepartmentListparentbyuserResponse.DeptListParentByUserResponse getParentDeptListByUserId(@NonNull String userId);
    
    /**
     * https://open.dingtalk.com/document/isvapp/address-book-search-department-id-1
     * @Description: 搜索部门ID
     * @param queryWord
     * @param offset
     * @param size
     * @date 2023-12-29 02:02:12
     */
    SearchDepartmentResponse searchDepartmentWithOptions(@NonNull String queryWord,Integer offset,Integer size);
}
